package com.test.typeGame.core;

import sun.audio.AudioPlayer;
import sun.audio.AudioStream;
import sun.misc.Resource;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.logging.Logger;

public class TGAudioPlayer {
    private static Logger logger = Logger.getLogger("TGAudioPlayer");
    private String addScoreVoiceFilename = "/sounds/bubbling.wav";

    public void playVoiceOfAddScore() {
        try {
            InputStream inputStream = this.getClass().getResourceAsStream(addScoreVoiceFilename);
            AudioStream audioStream = new AudioStream(inputStream);
            AudioPlayer.player.start(audioStream);
        } catch (Exception e) {
            logger.info(e.getMessage());
        }
    }
}
